package a.oschina.observedemo.demo3;

import java.util.ArrayList;
import java.util.List;


/**
 * &lt;功能详细描述&gt;
 *
 * @author Administrator
 * @version [版本号, 2018/10/23]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class Boss implements Subject {
    private List<Observer> mObservers=new ArrayList<>();
    private String action;

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Override
    public void attach(Observer observer) {
        mObservers.add(observer);

    }

    @Override
    public void deAttach(Observer observer) {
       mObservers.remove(mObservers);
    }

    @Override
    public void notifyObserver() {
        for (Observer observer : mObservers) {
            observer.update();
        }

    }
}
